Skip to content

Migrate to Spring Data JDBC and Update Repositories#1

Merged
MathEyraud merged 1 commit into
mainfrom
Spring-Data-JDBC
Jun 12, 2024
Merged

Migrate to Spring Data JDBC and Update Repositories#1
MathEyraud merged 1 commit into
mainfrom
Spring-Data-JDBC

Conversation

@MathEyraud

Copy link
Copy Markdown
Owner
  • Replaced Spring JDBC with Spring Data JDBC dependencies in pom.xml
  • Updated Invoice entity to use Spring Data annotations
  • Modified repository interfaces and classes to extend Spring Data CrudRepository
  • Updated service methods to return Iterable instead of List
  • Ensured consistency and added necessary imports for Spring Data JDBC

Details:

  • pom.xml:

    • Removed dependency for spring-boot-starter-jdbc
    • Added dependency for spring-boot-starter-data-jdbc
    • Updated Maven Compiler Plugin configuration
  • Invoice.java:

  • Repository Classes:

    • Updated repository interfaces to extend CrudRepository
    • Removed custom repository implementations for compatibility with Spring Data JDBC
  • InvoiceService.java:

    • Changed method signatures to return Iterable instead of List
    • Updated method implementations to use Spring Data repository methods
  • Specific Invoice Service Implementations (InvoiceServiceNumber, InvoiceServicePrefix, InvoiceServicePrefixINV):

    • Changed method signatures to return Iterable instead of List
    • Updated method implementations to use Spring Data repository methods
    • Added necessary imports and handled exceptions appropriately

This commit ensures that the core project is now aligned with Spring Data JDBC, facilitating easier repository management and more robust data handling.

- Replaced Spring JDBC with Spring Data JDBC dependencies in pom.xml
- Updated Invoice entity to use Spring Data annotations
- Modified repository interfaces and classes to extend Spring Data CrudRepository
- Updated service methods to return Iterable<Invoice> instead of List<Invoice>
- Ensured consistency and added necessary imports for Spring Data JDBC

Details:
- pom.xml:
  - Removed dependency for spring-boot-starter-jdbc
  - Added dependency for spring-boot-starter-data-jdbc
  - Updated Maven Compiler Plugin configuration

- Invoice.java:
  - Added Spring Data annotations (@id, @column, @table)

- Repository Classes:
  - Updated repository interfaces to extend CrudRepository
  - Removed custom repository implementations for compatibility with Spring Data JDBC

- InvoiceService.java:
  - Changed method signatures to return Iterable<Invoice> instead of List<Invoice>
  - Updated method implementations to use Spring Data repository methods

- Specific Invoice Service Implementations (InvoiceServiceNumber, InvoiceServicePrefix, InvoiceServicePrefixINV):
  - Changed method signatures to return Iterable<Invoice> instead of List<Invoice>
  - Updated method implementations to use Spring Data repository methods
  - Added necessary imports and handled exceptions appropriately

This commit ensures that the core project is now aligned with Spring Data JDBC, facilitating easier repository management and more robust data handling.
@MathEyraud MathEyraud merged commit ec110cc into main Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant